package com.ikaros.enums;

import lombok.Getter;

/**
 * Created by Ikaros on 2017/9/18.
 */
@Getter
public enum  OrderStatusEnums implements CodeEnum{
    NEW(0,"新订单"),
    FINISH(1,"已完成"),
    CANCEL(2,"已取消");
    private Integer code;
    private String massage;

    OrderStatusEnums(Integer code, String massage) {
        this.code = code;
        this.massage = massage;
    }

    public static OrderStatusEnums getEnums(Integer code){
        for ( OrderStatusEnums orderStatusEnums:OrderStatusEnums.values()){
            if (orderStatusEnums.getCode().equals(code)){
                return orderStatusEnums;
            }
        }
        return null;
    }
}
